package com.zmc.lostfound.auth.dao;

import com.zmc.lostfound.auth.entity.PermissionEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author ZMC
 * @email 2869581855@qq.com
 * @date 2023-07-05 15:17:37
 */
@Repository
public interface PermissionDao extends BaseMapper<PermissionEntity> {

    /**
     * 按用户id查询权限信息
     *
     * @param userId 用户id
     * @return List<PermissionEntity>
     */
    List<PermissionEntity> queryInfoByUserId(@Param("userId") Long userId);

    /**
     * 按角色id查询权限信息
     *
     * @param roleId 角色id
     * @return List<PermissionEntity>
     */
    List<PermissionEntity> queryInfoByRoleId(@Param("roleId") Long roleId);

}
